package com.bluestarenergy.party.sample.domain;


public class Hub extends PartyRole {

	private static final long serialVersionUID = 1L;
	//private List<Region> regionList;
	
	public String getHubName() {
		String hubName = "";
		Organization org = (Organization) getParty();
		if (org != null ){
			OrganizationDetail detail = org.getOrganizationDetail();
			if (detail != null &&
					detail.getOrganizationName() != null &&
					! "".equalsIgnoreCase(detail.getOrganizationName().trim())) {
				hubName = org.getOrganizationDetail().getOrganizationName();
			}
		}
		return hubName;
	}

	public String getShortName() {
		String shortName = "";
		Organization org = (Organization) getParty();
		if (org != null ){
			OrganizationDetail detail = org.getOrganizationDetail();
			if (detail != null &&
					org.getOrganizationDetail().getAlias() != null &&
					! "".equalsIgnoreCase(org.getOrganizationDetail().getAlias().trim())) {
				shortName = org.getOrganizationDetail().getAlias();
			}
		}
		return shortName;
	}
}